package c.w.taxi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;

import com.www.taxi.R;

public class AppStartActivity extends Activity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		final View view = View.inflate(this, R.layout.activity_start_layout, null);
		setContentView(view);

		AlphaAnimation aa = new AlphaAnimation(0.3f, 1.0f);
		aa.setDuration(3000);
		view.startAnimation(aa);
		
		aa.setAnimationListener(new AnimationListener() {
			public void onAnimationEnd(Animation arg0) {
				redirectTo();
			}

			public void onAnimationRepeat(Animation animation) {
			}

			public void onAnimationStart(Animation animation) {
			}

		});
	}

	private void redirectTo() {
		Intent intent = new Intent(this, FirstLoginActivity.class);
		startActivity(intent);
		int version =  Integer.valueOf(android.os.Build.VERSION.SDK);
		if(version > 5 ){
			//在进入下一个页面时，设置的动态效果
			overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);				
		}
		finish();
	}
}
